package com.yubest.springboothello.controller;

import com.yubest.springboothello.netty.NettyChannelManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/netty")
public class NettyController {

    @GetMapping(value = "/send")
    public Object send(@RequestParam(required = false) String channelId, @RequestParam String msg) {
        NettyChannelManager.send(channelId, msg);
        return "ok";
    }
}
